#include <stdio.h>

int main() {
	int n;
	scanf("%d", &n);  // 输入矩阵阶数
	int matrix[n][n];
	
	// 读取矩阵
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < n; j++) {
			scanf("%d", &matrix[i][j]);
		}
	}
	
	// 寻找鞍点
	int saddle_point_row = -1, saddle_point_col = -1;
	for (int i = 0; i < n; i++) {
		// 找每行最大值
		int max_in_row = matrix[i][0];
		for (int j = 1; j < n; j++) {
			if (matrix[i][j] > max_in_row) {
				max_in_row = matrix[i][j];
			}
		}
		// 找最大值所在列的最小值
		for (int j = 0; j < n; j++) {
			if (matrix[i][j] == max_in_row) {
				int min_in_col = matrix[0][j];
				for (int k = 1; k < n; k++) {
					if (matrix[k][j] < min_in_col) {
						min_in_col = matrix[k][j];
					}
				}
				// 判断是否为鞍点
				if (min_in_col == max_in_row) {
					saddle_point_row = i;
					saddle_point_col = j;
					break;
				}
			}
		}
		// 如果已经找到鞍点，则直接退出循环
		if (saddle_point_row != -1 && saddle_point_col != -1) {
			break;
		}
	}
	
	// 输出鞍点位置
	if (saddle_point_row != -1 && saddle_point_col != -1) {
		printf("%d %d\n", saddle_point_row, saddle_point_col);
	} else {
		printf("NONE\n");
	}
	
	return 0;
}

